-
Notifications
You must be signed in to change notification settings - Fork 284
feat: add top
endpoint to supplies
#45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
src/supply/supply.controller.ts
Outdated
@Get('top') | ||
async top(@Query('limit') limit: number = 10, @Query('skip') skip: number) { | ||
try { | ||
if (limit && typeof limit === 'string') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
é só usar o pipe ParseIntPipe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Boa, ajustado!
Vou precisar mudar a abordagem. O Prisma, ao que tudo indica, não suporta JOIN no |
@AndersonCRocha atualizei o PR utilizando uma nova query para que sejam contados os top N items por abrigo. Incluído também o filtro por abrigo ( |
@balsemao Veja o que consegue usar desse commit cesarpastorini@e74abe5 |
Valeu! Eu acabei fazendo o CAST para |
Adicionado o endpoint
/supplies/top
com os parâmetrospage
eperPage
.Em seguida atualizo com o filtro por abrigo.